Fill CUDA opset gap for ReduceMax and ReduceMin (18 → 20)#27755
Merged
Fill CUDA opset gap for ReduceMax and ReduceMin (18 → 20)#27755
Conversation
… 18 to opset 20 Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
tianleiwu
March 19, 2026 00:05
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Extends CUDA ONNX-domain ReduceMax/ReduceMin registrations to cover the opset 19-20 gap by splitting the old opset-18+ registrations into 1-17, 18-19, and 20+. This fits the broader CUDA provider work to keep kernel registry coverage aligned with newer ONNX opsets.
Changes:
- Added a versioned CUDA reduction registration macro that preserves
axesas a CPU input for ranged opset registrations. - Split
ReduceMaxandReduceMinCUDA kernel declarations/registrations into18-19and20+entries in the CUDA provider. - Added CUDA-focused opset-20 reduction tests for multiple data types and
keepdimssettings.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
onnxruntime/test/providers/cpu/reduction/reduction_ops_test.cc |
Adds CUDA-oriented opset-20 tests for ReduceMax/ReduceMin. |
onnxruntime/core/providers/cuda/reduction/reduction_ops.cc |
Splits reduction kernel registrations by opset range and adds a helper macro for ranged registrations with CPU axes input. |
onnxruntime/core/providers/cuda/cuda_execution_provider.cc |
Updates CUDA EP forward declarations and kernel registration table entries for the new opset ranges. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…able Add forward declarations and BuildKernelCreateInfo entries for ReduceMax with int8_t and uint8_t types at opsets 1-17, 18-19, and 20 in the CUDA execution provider registration table. These were already registered in reduction_ops.cc but missing from the provider table, which would cause kernel lookup failures for 8-bit ReduceMax models.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
titaiwangms
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Extends CUDA ReduceMax and ReduceMin kernel registrations from opset 18 to opset 20.
reduction_ops.cc: AddedREGISTER_KERNEL_VERSIONED_RANGE_AXES_INPUT_TYPEDmacro for versioned ranges requiringInputMemoryType(OrtMemTypeCPUInput, 1). Split both operators from 2-way (1–17, 18+) to 3-way (1–17, 18–19, 20+).cuda_execution_provider.cc: Capped opset 18 forward declarations andBuildKernelCreateInfoentries to versioned 18–19. Added opset 20 non-versioned entries for both operators.Type coverage maintained as-is: ReduceMax (float, double, MLFloat16, int32_t, int64_t), ReduceMin adds int8_t, uint8_t.
Motivation and Context
ReduceMax and ReduceMin CUDA registrations stopped at opset 18; ONNX latest is opset 20. Models exported with opset 19–20 could fail to find a matching CUDA kernel for these ops.
Follows the same pattern used in #27735 (TopK) and other opset gap PRs tracked in #27729.